<template>
  <!-- 回到顶部组件 -->
  <view class="com-backTop" @click="onTopBack" v-if="fixed">
    <uni-icons type="up" size="30" color="#888"></uni-icons>
  </view>
</template>


<script lang="ts" setup>
const props = defineProps({
  fixed: {
    type: Boolean,
    default: false
  }
});

const onTopBack = () => {
  uni.pageScrollTo({
    scrollTop: 0,
    duration: 1000
  });
};
</script>


<style lang="scss" scoped>
@use "style.scss";
</style>